package faktorI;

public class Iterator {
	private Lista lista;
	private Elem currentItem;
	
	public Iterator(Lista lista){
		this.lista = lista;
	}
	
	public Elem first(){return currentItem = lista.prvo;};
	public Elem next(){
		if(!isDone())return currentItem = currentItem.next;
		else return null;
	}
	public boolean isDone(){
		if(currentItem == null)return true;
		else return false;
	}
	public Elem currentItem(){return currentItem;}
}
